package demon;

public class Notebook {
    public void openDevice(){
        System.out.println("开机");
    }


    public void closeDevice() {
        System.out.println("关机");
    }
    public void useUsb(IUsb iUsb){
        iUsb.openDevice();
        if (iUsb instanceof Mouse){
            Mouse mouse=(Mouse) iUsb;
            mouse.click();
        }else {
            Keybord keybord=(Keybord) iUsb;
            keybord.input();
        }
        iUsb.closeDevice();
    }
}
